package com.kevin.websocket.client.model.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 发布类型
 */
@Getter
@RequiredArgsConstructor
public enum PublishType {

    BROADCAST("0"), // 广播
    MULTICAST("1"), // 组播
    UNICAST("2"), // 单播
    ;

    private final String value;

    public static PublishType valueOfVal(String value) {
        for (PublishType publishType : PublishType.values()) {
            if (publishType.getValue().equals(value)) {
                return publishType;
            }
        }
        throw new UnsupportedOperationException("Unsupported PublishType");
    }

}
